home *** CD-ROM | disk | FTP | other *** search
/ MacHack 2001 / MacHack 2001.toast / pc / The Hacks / GrowBoxDock / Sources / MacIncludes.h < prev    next >
Encoding:
C/C++ Source or Header  |  2001-01-30  |  7.2 KB  |  214 lines

  1. /*
  2.     File:        MacIncludes.h
  3.  
  4.     Contains:    This file contains all of the Mac includes that one needs
  5.  
  6.     Version:    Mac OS X
  7.  
  8.     Disclaimer:    IMPORTANT:  This Apple software is supplied to you by Apple Computer, Inc.
  9.                 ("Apple") in consideration of your agreement to the following terms, and your
  10.                 use, installation, modification or redistribution of this Apple software
  11.                 constitutes acceptance of these terms.  If you do not agree with these terms,
  12.                 please do not use, install, modify or redistribute this Apple software.
  13.  
  14.                 In consideration of your agreement to abide by the following terms, and subject
  15.                 to these terms, Apple grants you a personal, non-exclusive license, under Apple’s
  16.                 copyrights in this original Apple software (the "Apple Software"), to use,
  17.                 reproduce, modify and redistribute the Apple Software, with or without
  18.                 modifications, in source and/or binary forms; provided that if you redistribute
  19.                 the Apple Software in its entirety and without modifications, you must retain
  20.                 this notice and the following text and disclaimers in all such redistributions of
  21.                 the Apple Software.  Neither the name, trademarks, service marks or logos of
  22.                 Apple Computer, Inc. may be used to endorse or promote products derived from the
  23.                 Apple Software without specific prior written permission from Apple.  Except as
  24.                 expressly stated in this notice, no other rights or licenses, express or implied,
  25.                 are granted by Apple herein, including but not limited to any patent rights that
  26.                 may be infringed by your derivative works or by other works in which the Apple
  27.                 Software may be incorporated.
  28.  
  29.                 The Apple Software is provided by Apple on an "AS IS" basis.  APPLE MAKES NO
  30.                 WARRANTIES, EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION THE IMPLIED
  31.                 WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY AND FITNESS FOR A PARTICULAR
  32.                 PURPOSE, REGARDING THE APPLE SOFTWARE OR ITS USE AND OPERATION ALONE OR IN
  33.                 COMBINATION WITH YOUR PRODUCTS.
  34.  
  35.                 IN NO EVENT SHALL APPLE BE LIABLE FOR ANY SPECIAL, INDIRECT, INCIDENTAL OR
  36.                 CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
  37.                 GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
  38.                 ARISING IN ANY WAY OUT OF THE USE, REPRODUCTION, MODIFICATION AND/OR DISTRIBUTION
  39.                 OF THE APPLE SOFTWARE, HOWEVER CAUSED AND WHETHER UNDER THEORY OF CONTRACT, TORT
  40.                 (INCLUDING NEGLIGENCE), STRICT LIABILITY OR OTHERWISE, EVEN IF APPLE HAS BEEN
  41.                 ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  42.  
  43.     Copyright © 1990-2001 Apple Computer, Inc., All Rights Reserved
  44. */
  45.  
  46.  
  47. #ifndef __MACINCLUDES__
  48. #define __MACINCLUDES__
  49.  
  50. #if (!defined(UseMacDump))
  51.  
  52. #ifndef BUILDING_FOR_SYSTEM7
  53.     #define BUILDING_FOR_SYSTEM7 1
  54. #endif
  55.  
  56. #if defined(USE_UMBRELLA_HEADERS) && USE_UMBRELLA_HEADERS
  57. #include <Carbon.h>
  58. #else
  59. #include <MacTypes.h>
  60. #include <Resources.h>
  61. #include <Quickdraw.h>
  62. #include <Fonts.h>
  63. #include <Events.h>
  64. #include <MacWindows.h>
  65. #include <Menus.h>
  66. #include <TextEdit.h>
  67. #include <Dialogs.h>
  68. #include <ToolUtils.h>
  69. #include <MacMemory.h>
  70. #include <SegLoad.h>
  71. #include <ControlDefinitions.h>
  72. #include <Files.h>
  73. #include <OSUtils.h>
  74. #include <Traps.h>    
  75. #include <Script.h>
  76. #include <ColorPicker.h>
  77. #include <FixMath.h>
  78. #include <Packages.h>
  79. #include <Palettes.h>
  80. #include <QDOffscreen.h>
  81. #include <Sound.h>
  82. #include <Errors.h>
  83. #include <AppleEvents.h>
  84. #include <DiskInit.h>
  85. #include <Retrace.h>
  86. #include <Folders.h>
  87. #include <Lists.h>
  88. //#include <CTBUtilities.h>
  89. #include <Gestalt.h>
  90. #include <Finder.h>
  91. #include <Scrap.h>
  92. #include <Devices.h>
  93. #include <Video.h>
  94. #include <Aliases.h>
  95. #include <SoundInput.h>
  96. #include <Movies.h>
  97. #include <Printing.h>
  98. #include <Balloons.h>
  99. #include <MixedMode.h>
  100. #include <Drag.h>
  101. #include <TextServices.h>
  102. #include <TSMTE.h>
  103. #include <AppleGuide.h>
  104. #include <Speech.h>
  105. #include <Icons.h>
  106. #include <LowMem.h>
  107. #include <CodeFragments.h>
  108. #include <TextUtils.h>
  109. #include <Appearance.h>
  110. #include <PLStringFuncs.h>
  111. #include <OSA.h>        // for AppleScript
  112. #include <AEDataModel.h>    // for AppleScript
  113. #include <Threads.h>
  114. #include <Controls.h>
  115. #include <ImageCompression.h>    // for CustomGetFilePreview
  116. #include <Components.h>        // for AppleScript
  117. #include <Processes.h>
  118.  
  119. #if MOUSE_WHEEL_SUPPORT
  120. #include <CarbonEvents.h>
  121. #endif
  122.  
  123. #if ALLOW_QUICKTIME
  124. #include "QuickTimeComponents.h"
  125. // #include "GraphicsImporter.h"
  126. #endif
  127.  
  128. #define nrequire(CONDITION, LABEL) if (true) {if ((CONDITION)) goto LABEL; }
  129. #define require(CONDITION, LABEL) if (true) {if (!(CONDITION)) goto LABEL; }
  130. #endif
  131.  
  132. // #include "AGFile.h"
  133. #include "NavigationServicesSupport.h"
  134.  
  135. // Balloons.h
  136. #define kDefaultBalloonVariant    2
  137.  
  138. // For looking at all of our windows, not just the visible ones.
  139.  
  140. // No glue for this either, sigh.
  141. #define TESetClickLoop(L,H) ((**(H)).clickLoop = (L))
  142.  
  143. // defines I like to use all of the time
  144. extern void _DataInit();        // part of Runtime library
  145.  
  146. #define TopLeft(aRect)    (* (Point *) &(aRect).top)
  147. #define BotRight(aRect)    (* (Point *) &(aRect).bottom)
  148.  
  149. #define RectWidth(aRect) ((aRect).right - (aRect).left)
  150. #define RectHeight(aRect) ((aRect).bottom - (aRect).top)
  151.  
  152. #define Max(X, Y) ( ((X)>(Y)) ? (X) : (Y) )
  153. #define Min(X, Y) (  ((X)>(Y)) ? (Y) : (X) )
  154.  
  155. #define Pin(VALUE, MIN, MAX) ( ((VALUE) < (MIN)) ? (MIN) : ( ((VALUE) > (MAX)) ? (MAX) : (VALUE) ) )
  156.  
  157. // The Pascal equivalent of strcpy, takes two Pascal string pointers
  158. #define PSTRCPY(P1, P2)    BlockMove(P2, P1, P2[0]+1)
  159.  
  160. // Concatante one character C onto the string S 
  161. #define CHARCAT(S, C)    S[(S[0]+1)] = C; S[0]++;
  162.  
  163. /* The Pascal equivalent of strcat, takes two Pascal string pointers */
  164. #define PSTRCAT(P1, P2)                         \
  165.     BlockMove(&P2[1], &P1[(P1[0]+1)], P2[0]);    \
  166.     P1[0] += P2[0];
  167.  
  168.     #if defined(MakeMacDump)
  169.         #pragma dump "MacIncludesDump"
  170.     #endif
  171.  
  172. #else        // from the if !defined at the top of the file
  173.  
  174.     #if defined(UseMacDump)
  175.         #pragma load "MacIncludesDump"
  176.     #endif
  177. #endif
  178.  
  179. // this is a workaround for the current lack of prototypes for the old
  180. // scrap APIs in Scrap.h. I would just go ahead and adopt the new routines
  181. // but they aren't implemented on X yet...
  182. #if PRAGMA_STRUCT_ALIGN
  183.         #pragma options align=mac68k
  184. #elif PRAGMA_STRUCT_PACKPUSH
  185.         #pragma pack(push, 2)
  186. #elif PRAGMA_STRUCT_PACK
  187.         #pragma pack(2)
  188. #endif
  189.  
  190. EXTERN_API( long )
  191. GetScrap                                                (Handle                                 destination,
  192.                                                                  ScrapFlavorType                flavorType,
  193.                                                                  SInt32 *                               offset)
  194.                                 ONEWORDINLINE(0xA9FD);
  195.  
  196. EXTERN_API( OSStatus )
  197. ZeroScrap                                               (void)
  198.                                 ONEWORDINLINE(0xA9FC);
  199.  
  200. EXTERN_API( OSStatus )
  201. PutScrap                                                (SInt32                                 sourceBufferByteCount,
  202.                                                                  ScrapFlavorType                flavorType,
  203.                                                                  const void *                   sourceBuffer)
  204.                 ONEWORDINLINE(0xA9FE);
  205. #if PRAGMA_STRUCT_ALIGN
  206.         #pragma options align=reset
  207. #elif PRAGMA_STRUCT_PACKPUSH
  208.         #pragma pack(pop)
  209. #elif PRAGMA_STRUCT_PACK
  210.         #pragma pack()
  211. #endif
  212.  
  213. #endif /* __MACINCLUDES__ */
  214.